﻿@{
    ViewBag.Title = "首页";
    Layout = "~/Views/Shared/Main.cshtml";
    //正在进行
    var philosopherBema = ViewData["PhilosopherBema"] as HanGu.Entity.VBemaLecturerInfo ?? new HanGu.Entity.VBemaLecturerInfo();
    var News = ViewData["News"] as List<HanGu.Entity.News>;
    var Bemas = ViewData["Bemas"] as List<HanGu.Entity.VBemaLecturerInfo>;
}
@section Banner
{
    @Html.Partial("Banner")
}
@section Content{
    <div class="contentLeft">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/index_23.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    @* @{
                    int len = 100;
                    string OurServices=Hangu.WebClient.MyHtmlHelper.FormatHtml(ViewData["OurServices"]).ToHtmlString();
                    if(OurServices.Length<len)
                    {len=OurServices.Length;}
                    OurServices = OurServices.Substring(len);
                    }*@
                    <div style="padding-top: 10px; height: 305px; width: 100%; line-height: 18px; overflow: hidden;
                        text-overflow: ellipsis;">
                        @Hangu.WebClient.MyHtmlHelper.FormatHtml(ViewData["OurServices"])
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="contentRight">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/index_27.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="movieContain">
                        <div class="parent_panel">
                            <div class="movie_image_panel">
                                @if (!string.IsNullOrEmpty(philosopherBema.TitlePic))
                                {
                                    <a href="@philosopherBema.RedirectUrl">
                                        <img src="@philosopherBema.TitlePic" style="width:340px;height:130px" alt="@philosopherBema.Title" /></a>
                                }
                            </div>
                            <div class="movie_text_panel">
                                <ul>
                                    @*<li>讲师：
                                        @{
                                            if (philosopherBema != null && !string.IsNullOrEmpty(philosopherBema.LecturerID) && !string.IsNullOrEmpty(philosopherBema.LecturerName))
                                            {
                                                string[] lecturerids = philosopherBema.LecturerID.Split(',');
                                                string[] lecturerNames = philosopherBema.LecturerName.Split(',');
                                                if (lecturerids != null && lecturerNames != null && lecturerids.Length == lecturerNames.Length)
                                                {
                                                    for (int i = 0; i < lecturerids.Length; i++)
                                                    {
                                            <a href="/Lecturers/detail/@lecturerids[i]">@lecturerNames[i]</a>
                                                    }
                                                }
                                            }
                                        }
                                    </li>
                                    <li>主题：<a href="@philosopherBema.RedirectUrl">@philosopherBema.Title</a></li>
                                    <li>时间：@philosopherBema.PlayTime</li>
                                    <li>地点：@philosopherBema.PlayAddress</li>*@
                                    <li>
                                        <div style=" height:160px;overflow: hidden;text-overflow: ellipsis;" title="@Hangu.WebClient.MyHtmlHelper.FormatHtml(@philosopherBema.Summary)">
                                            <a href="@philosopherBema.RedirectUrl">简介：@Hangu.WebClient.MyHtmlHelper.FormatHtml(@philosopherBema.Summary)
                                            </a>@*@{
                                            int len = 210;
                                            string html = Hangu.WebClient.MyHtmlHelper.FormatHtml(@philosopherBema.Summary).ToHtmlString();
                                            if (html.Length > len)
                                            { html = html.Substring(0, len) + "..."; }
                                            @html;
                                        }*@
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear">
    </div>
    <div style="margin: 10px;">
        <table cellpadding="0" cellspacing="0" id="partContent" style="width: 100%">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/index_40.gif" alt=""></div>
                        <div class="ContentTitleRight">
                            <a href="/fnews"><span class="ContentTitleRight">更多》</span></a></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="NewsList">
                        <table cellpadding="2" cellspacing="0" border="0">
                            <tr align="center">
                                @foreach (var item in News)
                                {
                                    <td style="padding-left: 5px; padding-right: 5px">
                                        <p class="movie_image_panel">
                                            @if (!string.IsNullOrEmpty(item.TitlePic))
                                            {
                                                <a href="/rostrum/Detail/@item.ID">
                                                    <img src="@item.TitlePic" style="width: 136px; height: 77px;" alt="@item.Title"></a>
                                            }</p>
                                        <p class="lineHidden" style="width: 120px">
                                            <a href="/rostrum/Detail/@item.ID">@item.Title</a></p>
                                        <p>
                                            <span formatdate="yyyy年MM月dd日">@item.UpdateTime</span></p>
                                    </td>
                                }
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    @*
    <div class="contentLeft">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/index_40.gif" alt=""></div>
                        <div class="ContentTitleRight">
                            <a href="/fnews"><span class="ContentTitleRight">更多》</span></a></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="NewsList">
                        <ul>
                            @foreach (var item in News)
                            {
                                <li><a href="/FNews/Detail/@item.ID">@item.Title</a></li>
                            }
                        </ul>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="contentRight">
        <table cellpadding="0" cellspacing="0" id="partContent">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/index_43.gif" alt=""></div>
                        <div class="ContentTitleRight">
                            <a href="/rostrum/list"><span class="ContentTitleRight">更多》</span></a></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    @foreach (var item in Bemas)
                    {
                        <div class="movieContain">
                            <div class="parent_panel">
                                <div class="movie_image_panel">
                                    @if (!string.IsNullOrEmpty(item.TitlePic))
                                    {
                                        <a href="/rostrum/Detail/@item.ID">
                                            <img src="@item.TitlePic.Replace("_B", "_S")" style=" height:80px" alt="@item.Title" /></a>
                                    }
                                </div>
                                <div class="movie_text_panel">
                                    <ul>
                                        <li>讲师：<a href="/Lecturers/detail/@item.Lid" >@item.Name</a></li>
                                        <li>主题：<a href="/rostrum/Detail/@item.ID"> @item.Title </a></li>
                                        <li>时间：@item.PlayTime</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="clear">
                        </div>
                    }
                </td>
            </tr>
        </table>
    </div>*@
}
@section Side{
    @Html.Partial("Side")
}
